import time

from base import Base
from selenium.webdriver.common.by import By

class Test_Uploadfile(Base):
    def test_upload_file(self):
        self.driver.get('https://www.baidu.com/')
        self.driver.find_element(By.XPATH,'//*[@id="form"]/span[1]/span[2]').click()
        #这里设置了绝对路径找到了图片，需要看下相对路径的编写
        path_png = '/Users/chuqian/PycharmProjects/testpro1/1.png'
        self.driver.find_element(By.XPATH, '//*[@id="form"]/div/div[2]/div[2]/input').send_keys(path_png)
        time.sleep(3)